﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace DjBlog.Blog
{
    public partial class Post : System.Web.UI.Page
    {
        protected DjModel.PostInfo post = null;
        protected IList<DjModel.CommentInfo> commentlist = null;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Bind();
            }
        }

        private void Bind()
        {
            int postid = DjCommon.Utils.GetInt("postid", 0);
            if (postid > 0)
            {
                post = DjBll.Post.GetPostInfo(postid, DjModel.PostGetEnum.Normal);
                commentlist = DjBll.Post.GetPostCommentList(postid);
                DjBll.Post.UpdateRead(postid);
            }
        }
    }
}
